﻿<%@ Page Title="" Language="C#" MasterPageFile="~/CustomerPanel/CustomerSite.Master"
AutoEventWireup="true" CodeBehind="Booking.aspx.cs" Inherits="FastTrackCabService.CustomerPanel.Booking" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
    <title>Fast Track | Bookings</title>
    <link href="../Style/Supervisors.css" rel="stylesheet" type="text/css"/>
    <style>
        .select {
            -ms-border-radius: 0.5em;
            border-radius: 0.5em;
            outline: none;
            padding: 0.5em;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table style="margin: 1.5em auto;">
                <tr>
                    <td>
                        <div class="searchBox" style="float: left;">
                            <asp:TextBox ID="tbSearch" runat="server" placeholder="Search by booking id" CssClass="myTextBox"
                                         TextMode="Number">
                            </asp:TextBox>
                            <asp:ImageButton ID="ibtnSearch" runat="server" OnClick="ibtnSearch_OnClick" ImageUrl="~/Images/magnifying_glass_icon.png"/>
                        </div>
                        <div style="color: gray; float: left; margin-left: 1em;">
                            Show
                            <asp:DropDownList ID="ddlType" runat="server" CssClass="select" OnSelectedIndexChanged="ddlType_OnSelectedIndexChanged"
                                              AutoPostBack="True">
                                <asp:ListItem Value="Pick" Selected="True">Pick</asp:ListItem>
                                <asp:ListItem Value="PickAndDrop">Pick & Drop</asp:ListItem>
                            </asp:DropDownList>
                            bookings
                        </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:GridView ID="dgvBookings" CssClass="supervisors" runat="server" CellPadding="4"
                                      ForeColor="#333333" GridLines="None" AllowPaging="True" AutoGenerateColumns="False"
                                      OnPageIndexChanging="gvDrivers_OnPageIndexChanging">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775"/>
                            <Columns>
                                <asp:BoundField DataField="BookingId" HeaderText="Id"/>
                                <asp:BoundField DataField="OriginDateTime" HeaderText="Pickup Time"/>
                                <asp:BoundField DataField="OriginLocation.City" HeaderText="From"/>
                                <asp:TemplateField HeaderText="To">
                                    <ItemTemplate>
                                        <%# ddlType.SelectedValue.Equals("Pick") ? Eval("Destination") : Eval("MidPoint") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Status" HeaderText="Status"/>
                                <asp:TemplateField HeaderText="Action">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="ibView" ToolTip="View full details" Width="30" PostBackUrl='<%# (Eval("Status").Equals("Pending") || Eval("Status").Equals("Approved")) ? "ModifyBooking.aspx?id=" + Eval("BookingId") : "BookingFullView.aspx?bookingId=" + Eval("BookingId") %>'
                                                         ImageUrl="../Images/full-view.png" runat="server"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EmptyDataRowStyle CssClass="emptyDataRow"></EmptyDataRowStyle>
                            <EmptyDataTemplate>
                                <table class="supervisors" id="ContentPlaceHolder1_gvDrivers" style="border-collapse: collapse; color: #333333; width: 600px;">
                                    <tr style="background-color: #5D7B9D; color: White; font-weight: bold;">
                                        <th scope="col">
                                            Id
                                        </th>
                                        <th scope="col">
                                            Pickup Time
                                        </th>
                                        <th scope="col">
                                            From
                                        </th>
                                        <th scope="col">
                                            To
                                        </th>
                                        <th scope="col">
                                            Status
                                        </th>
                                        <th scope="col">
                                            Action
                                        </th>
                                    </tr>
                                    <tr style="background-color: #F7F6F3; color: #333333;">
                                        <td colspan="6" style="padding: 0.5em;">
                                            NO BOOKING EXISTS
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <EditRowStyle BackColor="#999999"/>
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"/>
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333"/>
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333"/>
                            <SortedAscendingCellStyle BackColor="#E9E7E2"/>
                            <SortedAscendingHeaderStyle BackColor="#506C8C"/>
                            <SortedDescendingCellStyle BackColor="#FFFDF8"/>
                            <SortedDescendingHeaderStyle BackColor="#6F8DAE"/>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ImageButton ID="btnAdd" ToolTip="Add a Booking" ImageUrl="../Images/add-yellow.png"
                     PostBackUrl="Default.aspx" CssClass="addButton" runat="server"/>
</asp:Content>